<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位</title>
    <style>
        div{
            background: blue;
            height: 200px;
            width: 200px;
            color: red;
        }
        #d1{
            position: static;
        }
        #d2{
            position: relative;
            left: 200px;
        }
        #d3{
            position: absolute;
            background: greenyellow;
            top: 400px;
            left: 500px;
        }
        #d4{
            position: fixed;
            background: pink;
            top: 0px;
            left: 600px;
        }
    </style>
</head>
<body>
    <div id="d1">正常定位</div>
    <hr/>
    <div id="d2">相对定位</div>
    <hr/>
    <div id="d3">绝对定位</div>
    <hr/>
    <div id="d4">固定定位</div>
    <hr/>
    <div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>